﻿@using Kairos.Views

@model Kairos.Models.Document

@{
    ViewBag.Title = "Nouveau document";
}

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Document</legend>

        <table>
            <tr>
                <td>
                    <div class="editor-label">
                        @Html.LabelFor(model => model.Titre) :
                    </div>
                <td>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.Titre)
                        @Html.ValidationMessageFor(model => model.Titre)
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="editor-label">
                        @Html.LabelFor(model => model.MetaData_1) :
                    </div>
                <td>
                    <div class="editor-field">
                        @Html.DropDownList("MetaData_1ID", (SelectList)ViewBag.MetaData1, "Choisissez un type de document", new { @class = "ui-corner-all" })
                        @Html.ValidationMessageFor(model => model.MetaData_1)
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="editor-label">
                        @Html.LabelFor(model => model.MetaData_2) :
                    </div>
                <td>
                    <div class="editor-field">
                        @Html.DropDownList("MetaData_2ID", (SelectList)ViewBag.MetaData2, "Choisissez un logiciel associé", new { @class = "ui-corner-all" })
                        @Html.ValidationMessageFor(model => model.MetaData_2)
                    </div>
                </td>
            </tr>
        </table>

        <p />

        <table style="width:100%">
            <tr>
                <td colspan="2">
                    <div class="editor-field">
                        @Html.TextAreaFor(model => model.Contenu, 10, 80, null)
                        @Html.ValidationMessageFor(model => model.Contenu)
                    </div>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <div>
                        @Html.ButtonLink("Annuler", "Document", "Search", null, new { @class = "ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" })
                    </div>
                </td>
                <td align="right">
                    <div>
                        <input type="submit" value="Sauvegarder" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
                    </div>
                </td>
            </tr>
        </table>

    </fieldset>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/ckeditor")
    <script>
        CKEDITOR.replace("Contenu", { height: "300px", filebrowserImageUploadUrl: "@Url.Action("Create","Image")" });
    </script>
}
